<template>
  <div>
    <mu-flexbox @click.native="viewNews(news)">
      
      <mu-flexbox-item :grow="3">
        <div class="maxlen">{{news.title}}</div>
        <p class="t3 f12 mt10" style="margin-bottom:0;">
          {{news.createdate | format}}
        </p>
      </mu-flexbox-item>
      <mu-flexbox-item :grow="2" class="text-right">
        <img v-lazy="news.newurl" width="100" height="70" class="mt10"/>
      </mu-flexbox-item>
    </mu-flexbox>
    <mu-divider></mu-divider>
  </div>
</template>

<script>
import {formatDate} from '@/common/js/util'

export default {
  name: 'newslist',
  props: ['news'],
  filters: {
    format (val) {
      return formatDate(new Date(val), 'yyyy-MM-dd')
    }
  },
  methods: {
    viewNews (news) {
      sessionStorage.currentNews = JSON.stringify(news)
      this.$router.push('/about/news/' + news.drid)
    }
  }
}
</script>

<style>

</style>
